<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>i2c: C:/Users/Jon/Downloads/OOP/db-control/dbOpportunity.php Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">i2c
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">C:/Users/Jon/Downloads/OOP/db-control/dbOpportunity.php</div>  </div>
</div>
<div class="contents">
<a href="db_opportunity_8php.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 &lt;?php
<a name="l00002"></a>00002 
<a name="l00018"></a>00018 <span class="comment">/*</span>
<a name="l00019"></a>00019 <span class="comment"> * This is the database file.</span>
<a name="l00020"></a>00020 <span class="comment"> * It contacts the control file to know</span>
<a name="l00021"></a>00021 <span class="comment"> * which internship orrertunity data to get and set.</span>
<a name="l00022"></a>00022 <span class="comment"> * It is the only file that has the SQL queries and MySQL connections</span>
<a name="l00023"></a>00023 <span class="comment"> *</span>
<a name="l00024"></a>00024 <span class="comment"> */</span>
<a name="l00025"></a>00025 
<a name="l00026"></a><a class="code" href="classdb_opportunity.html">00026</a> <span class="keyword">class </span><a class="code" href="classdb_opportunity.html">dbOpportunity</a> {
<a name="l00027"></a>00027 
<a name="l00028"></a><a class="code" href="classdb_opportunity.html#aea6c4d653e217f31256ded5783ed58f4">00028</a>    <span class="keyword">static</span> <span class="keyword">function</span> <a class="code" href="classdb_opportunity.html#aea6c4d653e217f31256ded5783ed58f4">createTable</a>() {
<a name="l00029"></a>00029       <span class="comment">//Create table opportunity</span>
<a name="l00030"></a>00030       <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> = <span class="stringliteral">&quot;</span>
<a name="l00031"></a>00031 <span class="stringliteral">            create table opportunity(</span>
<a name="l00032"></a>00032 <span class="stringliteral">                opportunityID           int             NOT NULL AUTO_INCREMENT,</span>
<a name="l00033"></a>00033 <span class="stringliteral">                organizationID          int             NOT NULL,</span>
<a name="l00034"></a>00034 <span class="stringliteral">                contactID               int             NULL,</span>
<a name="l00035"></a>00035 <span class="stringliteral">                title                   varchar(100)    NOT NULL,</span>
<a name="l00036"></a>00036 <span class="stringliteral">                numPositionsAvailable   int             NOT NULL,</span>
<a name="l00037"></a>00037 <span class="stringliteral">                semester                varchar(50)     NOT NULL,</span>
<a name="l00038"></a>00038 <span class="stringliteral">                payRate                 varchar(32)     NOT NULL,</span>
<a name="l00039"></a>00039 <span class="stringliteral">                duration                varchar(50)     NOT NULL,</span>
<a name="l00040"></a>00040 <span class="stringliteral">                responsibilities        text            NOT NULL,</span>
<a name="l00041"></a>00041 <span class="stringliteral">                qualifications          text            NULL,</span>
<a name="l00042"></a>00042 <span class="stringliteral">                instructions            text            NULL,</span>
<a name="l00043"></a>00043 <span class="stringliteral">                comments                text            NULL,</span>
<a name="l00044"></a>00044 <span class="stringliteral">                categories              text            NULL,</span>
<a name="l00045"></a>00045 <span class="stringliteral">                pending                 int(1)          NULL,</span>
<a name="l00046"></a>00046 <span class="stringliteral">                dateAdded               timestamp       NOT NULL</span>
<a name="l00047"></a>00047 <span class="stringliteral"></span>
<a name="l00048"></a>00048 <span class="stringliteral">                DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,</span>
<a name="l00049"></a>00049 <span class="stringliteral">                constraint PK_Opportunity PRIMARY KEY (opportunityID),</span>
<a name="l00050"></a>00050 <span class="stringliteral">                constraint FK_Opportunity_Organization FOREIGN KEY</span>
<a name="l00051"></a>00051 <span class="stringliteral">                (organizationID)</span>
<a name="l00052"></a>00052 <span class="stringliteral">                    references organization (organizationID),</span>
<a name="l00053"></a>00053 <span class="stringliteral">                constraint FK_Opportunity_Contact FOREIGN KEY (contactID)</span>
<a name="l00054"></a>00054 <span class="stringliteral">                    references contact (contactID)</span>
<a name="l00055"></a>00055 <span class="stringliteral">                );</span>
<a name="l00056"></a>00056 <span class="stringliteral">      &quot;</span>;
<a name="l00057"></a>00057       <a class="code" href="db-control_2inc_2functions_8php.html#aca07cf60afd49a5a5b583459f5423045">connectToDatabase</a>();
<a name="l00058"></a>00058       <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> = mysql_query(<a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a>);
<a name="l00059"></a>00059       echo mysql_error();
<a name="l00060"></a>00060       mysql_close();
<a name="l00061"></a>00061       <span class="keywordflow">if</span> (<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> == <span class="keyword">false</span>) {
<a name="l00062"></a>00062          <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00063"></a>00063       }
<a name="l00064"></a>00064 
<a name="l00065"></a>00065       <span class="comment">//Previous query was successful.</span>
<a name="l00066"></a>00066       <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00067"></a>00067    }
<a name="l00068"></a>00068 
<a name="l00075"></a><a class="code" href="classdb_opportunity.html#ae2fe3bffe3a16a082e3ba2634240afca">00075</a>    <span class="keyword">static</span> <span class="keyword">function</span> <a class="code" href="classdb_opportunity.html#ae2fe3bffe3a16a082e3ba2634240afca">getAllOpportunities</a>() {
<a name="l00076"></a>00076       <a class="code" href="internship__list__dateadded_8php.html#a18b2a8d133fa7733bf34abcc6ca2ef5b">$category</a> = <a class="code" href="logout_8php.html#aa3f93905a0a94ad29ddd47d9e5638098">$_SESSION</a>[<span class="stringliteral">&#39;category&#39;</span>];
<a name="l00077"></a>00077       <a class="code" href="old_2internship-request_8php.html#a5b9ddd3e3a69d8901270064346bdef49">$city</a> = <a class="code" href="logout_8php.html#aa3f93905a0a94ad29ddd47d9e5638098">$_SESSION</a>[<span class="stringliteral">&#39;city&#39;</span>];
<a name="l00078"></a>00078       $major = <a class="code" href="logout_8php.html#aa3f93905a0a94ad29ddd47d9e5638098">$_SESSION</a>[<span class="stringliteral">&#39;major&#39;</span>];
<a name="l00079"></a>00079       $search = <a class="code" href="logout_8php.html#aa3f93905a0a94ad29ddd47d9e5638098">$_SESSION</a>[<span class="stringliteral">&#39;search&#39;</span>];
<a name="l00080"></a>00080       $sortBy = <a class="code" href="logout_8php.html#aa3f93905a0a94ad29ddd47d9e5638098">$_SESSION</a>[<span class="stringliteral">&#39;sortBy&#39;</span>];
<a name="l00081"></a>00081       $searchFor = <a class="code" href="logout_8php.html#aa3f93905a0a94ad29ddd47d9e5638098">$_SESSION</a>[<span class="stringliteral">&#39;searchFor&#39;</span>];
<a name="l00082"></a>00082 
<a name="l00083"></a>00083       <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> = <a class="code" href="classdb_opportunity.html#a770c3eef39022f2426f719145e1d282c">dbOpportunity::buildQuery</a>(<a class="code" href="internship__list__dateadded_8php.html#a18b2a8d133fa7733bf34abcc6ca2ef5b">$category</a>, <a class="code" href="old_2internship-request_8php.html#a5b9ddd3e3a69d8901270064346bdef49">$city</a>, $search, $sortBy, $searchFor);
<a name="l00084"></a>00084 
<a name="l00085"></a>00085 
<a name="l00086"></a>00086       <a class="code" href="db-control_2inc_2functions_8php.html#aca07cf60afd49a5a5b583459f5423045">connectToDatabase</a>();
<a name="l00087"></a>00087       <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> = mysql_query(<a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a>);
<a name="l00088"></a>00088       echo mysql_error();
<a name="l00089"></a>00089       mysql_close();
<a name="l00090"></a>00090 
<a name="l00091"></a>00091       <span class="keywordflow">if</span> (!<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>) {
<a name="l00092"></a>00092          <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00093"></a>00093       }
<a name="l00094"></a>00094       <span class="comment">//Query was successful.</span>
<a name="l00095"></a>00095       <span class="keywordflow">return</span> <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>;
<a name="l00096"></a>00096    }
<a name="l00097"></a>00097 
<a name="l00098"></a><a class="code" href="classdb_opportunity.html#a770c3eef39022f2426f719145e1d282c">00098</a>    <span class="keyword">function</span> <a class="code" href="classdb_opportunity.html#a770c3eef39022f2426f719145e1d282c">buildQuery</a>($cat, <a class="code" href="old_2internship-request_8php.html#a5b9ddd3e3a69d8901270064346bdef49">$city</a>, $search, $sort, $searchFor) {
<a name="l00099"></a>00099 
<a name="l00100"></a>00100       <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> = <span class="stringliteral">&quot;SELECT o.city, o.stateName, o.organizationName, io.* FROM</span>
<a name="l00101"></a>00101 <span class="stringliteral">                opportunity io, ORGANIZATION o</span>
<a name="l00102"></a>00102 <span class="stringliteral">                WHERE io.organizationID = o.organizationID</span>
<a name="l00103"></a>00103 <span class="stringliteral">                AND io.categories LIKE &#39;%$cat%&#39;</span>
<a name="l00104"></a>00104 <span class="stringliteral">                AND o.city LIKE &#39;%$city%&#39;&quot;</span>;
<a name="l00105"></a>00105 
<a name="l00106"></a>00106       <span class="keywordflow">switch</span> ($searchFor) {
<a name="l00107"></a>00107          <span class="keywordflow">case</span> <span class="stringliteral">&#39;Positions&#39;</span>:
<a name="l00108"></a>00108             <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> .= <span class="stringliteral">&quot;AND io.title LIKE &#39;%$search%&#39;&quot;</span>;
<a name="l00109"></a>00109             <span class="keywordflow">break</span>;
<a name="l00110"></a>00110          <span class="keywordflow">case</span> <span class="stringliteral">&#39;Qualifications&#39;</span>:
<a name="l00111"></a>00111             <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> .= <span class="stringliteral">&quot;AND io.qualifications LIKE &#39;%$search%&#39;&quot;</span>;
<a name="l00112"></a>00112             <span class="keywordflow">break</span>;
<a name="l00113"></a>00113          <span class="keywordflow">case</span> <span class="stringliteral">&#39;Responsibilities&#39;</span>:
<a name="l00114"></a>00114             <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> .= <span class="stringliteral">&quot;AND io.responsibilities LIKE &#39;%$search%&#39;&quot;</span>;
<a name="l00115"></a>00115             <span class="keywordflow">break</span>;
<a name="l00116"></a>00116          <span class="keywordflow">case</span> <span class="stringliteral">&#39;Organizations&#39;</span>:
<a name="l00117"></a>00117             <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> .= <span class="stringliteral">&quot;AND o.organizationName LIKE &#39;%$search%&#39;&quot;</span>;
<a name="l00118"></a>00118             <span class="keywordflow">break</span>;
<a name="l00119"></a>00119       }
<a name="l00120"></a>00120 
<a name="l00121"></a>00121       <span class="comment">//need to order by $sort</span>
<a name="l00122"></a>00122       <span class="keywordflow">switch</span> ($sort) {
<a name="l00123"></a>00123          <span class="keywordflow">case</span> <span class="stringliteral">&#39;org_asc&#39;</span>:
<a name="l00124"></a>00124             <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> .= <span class="stringliteral">&quot;ORDER BY o.organizationName ASC&quot;</span>;
<a name="l00125"></a>00125             <span class="keywordflow">break</span>;
<a name="l00126"></a>00126          <span class="keywordflow">case</span> <span class="stringliteral">&#39;org_desc&#39;</span>:
<a name="l00127"></a>00127             <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> .= <span class="stringliteral">&quot;ORDER BY o.organizationName DESC&quot;</span>;
<a name="l00128"></a>00128             <span class="keywordflow">break</span>;
<a name="l00129"></a>00129          <span class="keywordflow">case</span> <span class="stringliteral">&#39;city_asc&#39;</span>:
<a name="l00130"></a>00130             <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> .= <span class="stringliteral">&quot;ORDER BY o.city ASC&quot;</span>;
<a name="l00131"></a>00131             <span class="keywordflow">break</span>;
<a name="l00132"></a>00132          <span class="keywordflow">case</span> <span class="stringliteral">&#39;city_desc&#39;</span>:
<a name="l00133"></a>00133             <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> .= <span class="stringliteral">&quot;ORDER BY o.city DESC&quot;</span>;
<a name="l00134"></a>00134             <span class="keywordflow">break</span>;
<a name="l00135"></a>00135          <span class="keywordflow">case</span> <span class="stringliteral">&#39;sem_desc&#39;</span>:
<a name="l00136"></a>00136             <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> .= <span class="stringliteral">&quot;ORDER BY io.semester DESC&quot;</span>;
<a name="l00137"></a>00137             <span class="keywordflow">break</span>;
<a name="l00138"></a>00138          <span class="keywordflow">case</span> <span class="stringliteral">&#39;sem_asc&#39;</span>:
<a name="l00139"></a>00139             <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> .= <span class="stringliteral">&quot;ORDER BY io.semester ASC&quot;</span>;
<a name="l00140"></a>00140             <span class="keywordflow">break</span>;
<a name="l00141"></a>00141          <span class="keywordflow">case</span> <span class="stringliteral">&#39;pos_desc&#39;</span>:
<a name="l00142"></a>00142             <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> .= <span class="stringliteral">&quot;ORDER BY io.title DESC&quot;</span>;
<a name="l00143"></a>00143             <span class="keywordflow">break</span>;
<a name="l00144"></a>00144          <span class="keywordflow">case</span> <span class="stringliteral">&#39;pos_asc&#39;</span>:
<a name="l00145"></a>00145             <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> .= <span class="stringliteral">&quot;ORDER BY io.title ASC&quot;</span>;
<a name="l00146"></a>00146             <span class="keywordflow">break</span>;
<a name="l00147"></a>00147          <span class="keywordflow">case</span> <span class="stringliteral">&#39;numAvailable_asc&#39;</span>:
<a name="l00148"></a>00148             <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> .= <span class="stringliteral">&quot;ORDER BY io.numPositionsAvailable ASC&quot;</span>;
<a name="l00149"></a>00149             <span class="keywordflow">break</span>;
<a name="l00150"></a>00150          <span class="keywordflow">case</span> <span class="stringliteral">&#39;numAvailable_desc&#39;</span>:
<a name="l00151"></a>00151             <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> .= <span class="stringliteral">&quot;ORDER BY io.numPositionsAvailable DESC&quot;</span>;
<a name="l00152"></a>00152             <span class="keywordflow">break</span>;
<a name="l00153"></a>00153       }
<a name="l00154"></a>00154 
<a name="l00155"></a>00155       <span class="keywordflow">return</span> <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a>;
<a name="l00156"></a>00156    }
<a name="l00157"></a>00157 
<a name="l00158"></a><a class="code" href="classdb_opportunity.html#a0785aaa639cf656d77fdc1e833664d56">00158</a>    <span class="keyword">function</span> <a class="code" href="classdb_opportunity.html#a0785aaa639cf656d77fdc1e833664d56">repPaid</a>() {
<a name="l00159"></a>00159 
<a name="l00160"></a>00160       <a class="code" href="internship__list__dateadded_8php.html#a18b2a8d133fa7733bf34abcc6ca2ef5b">$category</a> = <a class="code" href="logout_8php.html#aa3f93905a0a94ad29ddd47d9e5638098">$_SESSION</a>[<span class="stringliteral">&#39;category&#39;</span>];
<a name="l00161"></a>00161       <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> = <span class="stringliteral">&quot;SELECT o.city, o.stateName, o.organizationName, io.* FROM</span>
<a name="l00162"></a>00162 <span class="stringliteral">      opportunity io, organization o WHERE o.organizationID = io.organizationID</span>
<a name="l00163"></a>00163 <span class="stringliteral">      AND io.categories LIKE &#39;%$category%&#39; ORDER BY io.payRate DESC&quot;</span>;
<a name="l00164"></a>00164       <a class="code" href="db-control_2inc_2functions_8php.html#aca07cf60afd49a5a5b583459f5423045">connectToDatabase</a>();
<a name="l00165"></a>00165       <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> = mysql_query(<a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a>);
<a name="l00166"></a>00166       echo mysql_error();
<a name="l00167"></a>00167       mysql_close();
<a name="l00168"></a>00168       <span class="keywordflow">if</span> (<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> == <span class="keyword">false</span>) {
<a name="l00169"></a>00169          <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00170"></a>00170       }
<a name="l00171"></a>00171       <span class="comment">//Query was successful.</span>
<a name="l00172"></a>00172       <span class="keywordflow">return</span> <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>;
<a name="l00173"></a>00173    }
<a name="l00174"></a>00174 
<a name="l00183"></a><a class="code" href="classdb_opportunity.html#a240d7c4fd55fe1b16251d5c385e809f9">00183</a>    <span class="keyword">function</span> <a class="code" href="classdb_opportunity.html#a240d7c4fd55fe1b16251d5c385e809f9">deleteFromOpportunity</a>($id) {
<a name="l00184"></a>00184 
<a name="l00185"></a>00185       <span class="comment">//Compose the DELETE FROM query string.</span>
<a name="l00186"></a>00186       <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> = sprintf(<span class="stringliteral">&quot;DELETE FROM opportunity WHERE opportunityID = %d&quot;</span>, $id);
<a name="l00187"></a>00187       <a class="code" href="db-control_2inc_2functions_8php.html#aca07cf60afd49a5a5b583459f5423045">connectToDatabase</a>();
<a name="l00188"></a>00188       <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> = mysql_query(<a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a>);
<a name="l00189"></a>00189       mysql_close();
<a name="l00190"></a>00190       <span class="keywordflow">if</span> (<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> == <span class="keyword">false</span>) {
<a name="l00191"></a>00191          echo mysql_error();
<a name="l00192"></a>00192          <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00193"></a>00193       }
<a name="l00194"></a>00194 
<a name="l00195"></a>00195       <span class="comment">//Query was successful.</span>
<a name="l00196"></a>00196       <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00197"></a>00197    }
<a name="l00198"></a>00198 
<a name="l00204"></a><a class="code" href="classdb_opportunity.html#a2fa0a0c52c0614e87c0962e995eb6267">00204</a>    <span class="keyword">function</span> <a class="code" href="classdb_opportunity.html#a2fa0a0c52c0614e87c0962e995eb6267">updateOpportunity</a>($id, $o) {
<a name="l00205"></a>00205       $opportunityID = $id;
<a name="l00206"></a>00206       $organizationID = <a class="code" href="db-control_2inc_2functions_8php.html#a61006d44ae8ce17e621047df954d5ab5">sanitizeStr</a>($o-&gt;getOrganizationID());
<a name="l00207"></a>00207       $contactID = <a class="code" href="db-control_2inc_2functions_8php.html#a61006d44ae8ce17e621047df954d5ab5">sanitizeStr</a>($o-&gt;getContactID());
<a name="l00208"></a>00208       $title = <a class="code" href="db-control_2inc_2functions_8php.html#a61006d44ae8ce17e621047df954d5ab5">sanitizeStr</a>($o-&gt;getTitle());
<a name="l00209"></a>00209       $numPositionsAvailable = <a class="code" href="db-control_2inc_2functions_8php.html#a61006d44ae8ce17e621047df954d5ab5">sanitizeStr</a>($o-&gt;getNumPositionsAvailable());
<a name="l00210"></a>00210       $semester = <a class="code" href="db-control_2inc_2functions_8php.html#a61006d44ae8ce17e621047df954d5ab5">sanitizeStr</a>($o-&gt;getSemester());
<a name="l00211"></a>00211       <a class="code" href="old_2internship-request_8php.html#a46a6159d1d52d7ac788b0d1eb8d4321f">$payrate</a> = <a class="code" href="db-control_2inc_2functions_8php.html#a61006d44ae8ce17e621047df954d5ab5">sanitizeStr</a>($o-&gt;getPayRate());
<a name="l00212"></a>00212       $duration = <a class="code" href="db-control_2inc_2functions_8php.html#a61006d44ae8ce17e621047df954d5ab5">sanitizeStr</a>($o-&gt;getDuration());
<a name="l00213"></a>00213       $rb = <a class="code" href="db-control_2inc_2functions_8php.html#a61006d44ae8ce17e621047df954d5ab5">sanitizeStr</a>($o-&gt;getResponsibilities());
<a name="l00214"></a>00214       $qualif = <a class="code" href="db-control_2inc_2functions_8php.html#a61006d44ae8ce17e621047df954d5ab5">sanitizeStr</a>($o-&gt;getQualifications());
<a name="l00215"></a>00215       $instruct = <a class="code" href="db-control_2inc_2functions_8php.html#a61006d44ae8ce17e621047df954d5ab5">sanitizeStr</a>($o-&gt;getInstructions());
<a name="l00216"></a>00216       <a class="code" href="old_2internship-request_8php.html#a35e8cdeb473a5eb016fea893d14de951">$comments</a> = <a class="code" href="db-control_2inc_2functions_8php.html#a61006d44ae8ce17e621047df954d5ab5">sanitizeStr</a>($o-&gt;getComments());
<a name="l00217"></a>00217       $categories = <a class="code" href="db-control_2inc_2functions_8php.html#a61006d44ae8ce17e621047df954d5ab5">sanitizeStr</a>($o-&gt;getCategories());
<a name="l00218"></a>00218       $pending = <a class="code" href="db-control_2inc_2functions_8php.html#a61006d44ae8ce17e621047df954d5ab5">sanitizeStr</a>($o-&gt;getPending());
<a name="l00219"></a>00219       $dateadded = <a class="code" href="db-control_2inc_2functions_8php.html#a61006d44ae8ce17e621047df954d5ab5">sanitizeStr</a>($o-&gt;getDateAdded());
<a name="l00220"></a>00220 
<a name="l00221"></a>00221       <a class="code" href="db-control_2inc_2functions_8php.html#aca07cf60afd49a5a5b583459f5423045">connectToDatabase</a>();
<a name="l00222"></a>00222 
<a name="l00223"></a>00223       <span class="keywordflow">if</span> ($opportunityID == <span class="stringliteral">&#39;&#39;</span>) {
<a name="l00224"></a>00224          <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00225"></a>00225       } <span class="keywordflow">else</span> {
<a name="l00226"></a>00226          <span class="keywordflow">if</span> ($organizationID != <span class="stringliteral">&#39;&#39;</span>) {
<a name="l00227"></a>00227             <span class="keywordflow">if</span> (!mysql_query(<span class="stringliteral">&quot;UPDATE opportunity SET organizationID=</span>
<a name="l00228"></a>00228 <span class="stringliteral">      &#39;$organizationID&#39; WHERE opportunityID=$opportunityID&quot;</span>))
<a name="l00229"></a>00229                die(<span class="stringliteral">&quot;Could not update organizationID with ID =</span>
<a name="l00230"></a>00230 <span class="stringliteral">                        $opportunityID&quot;</span>);
<a name="l00231"></a>00231          }
<a name="l00232"></a>00232          <span class="keywordflow">if</span> ($contactID != <span class="stringliteral">&#39;&#39;</span>) {
<a name="l00233"></a>00233             <span class="keywordflow">if</span> (!mysql_query(<span class="stringliteral">&quot;UPDATE opportunity SET contactID=&#39;$contactID&#39;</span>
<a name="l00234"></a>00234 <span class="stringliteral">      WHERE opportunityID=$opportunityID&quot;</span>))
<a name="l00235"></a>00235                die(<span class="stringliteral">&quot;Could not update contactID with ID = $opportunityID&quot;</span>);
<a name="l00236"></a>00236          }<span class="keywordflow">else</span>{
<a name="l00237"></a>00237            mysql_query(<span class="stringliteral">&quot;UPDATE opportunity SET contactID=null</span>
<a name="l00238"></a>00238 <span class="stringliteral">      WHERE opportunityID=$opportunityID&quot;</span>);
<a name="l00239"></a>00239          }
<a name="l00240"></a>00240          <span class="keywordflow">if</span> ($title != <span class="stringliteral">&#39;&#39;</span>) {
<a name="l00241"></a>00241             <span class="keywordflow">if</span> (!mysql_query(<span class="stringliteral">&quot;UPDATE opportunity SET title=&#39;$title&#39; WHERE</span>
<a name="l00242"></a>00242 <span class="stringliteral">      opportunityID=$opportunityID&quot;</span>))
<a name="l00243"></a>00243                die(<span class="stringliteral">&quot;Could not update title with ID = $opportunityID&quot;</span>);
<a name="l00244"></a>00244          }
<a name="l00245"></a>00245          <span class="keywordflow">if</span> ($numPositionsAvailable != <span class="stringliteral">&#39;&#39;</span>) {
<a name="l00246"></a>00246             <span class="keywordflow">if</span> (!mysql_query(<span class="stringliteral">&quot;UPDATE opportunity SET numPositionsAvailable=</span>
<a name="l00247"></a>00247 <span class="stringliteral">      &#39;$numPositionsAvailable&#39; WHERE opportunityID=$opportunityID&quot;</span>))
<a name="l00248"></a>00248                die(<span class="stringliteral">&quot;Could not update numPositionAvailable with ID =</span>
<a name="l00249"></a>00249 <span class="stringliteral">                    $opportunityID&quot;</span>);
<a name="l00250"></a>00250          }
<a name="l00251"></a>00251          <span class="keywordflow">if</span> ($semester != <span class="stringliteral">&#39;&#39;</span>) {
<a name="l00252"></a>00252             <span class="keywordflow">if</span> (!mysql_query(<span class="stringliteral">&quot;UPDATE opportunity SET semester=&#39;$semester&#39;</span>
<a name="l00253"></a>00253 <span class="stringliteral">      WHERE opportunityID=$opportunityID&quot;</span>))
<a name="l00254"></a>00254                die(<span class="stringliteral">&quot;Could not update semester with ID = $opportunityID&quot;</span>);
<a name="l00255"></a>00255          }
<a name="l00256"></a>00256          <span class="keywordflow">if</span> ($payrate != <span class="stringliteral">&#39;&#39;</span>) {
<a name="l00257"></a>00257             <span class="keywordflow">if</span> (!mysql_query(<span class="stringliteral">&quot;UPDATE opportunity SET payRate=&#39;$payrate&#39;</span>
<a name="l00258"></a>00258 <span class="stringliteral">      WHERE opportunityID=$opportunityID&quot;</span>))
<a name="l00259"></a>00259                die(<span class="stringliteral">&quot;Could not update payRate with ID = $opportunityID&quot;</span>);
<a name="l00260"></a>00260          }
<a name="l00261"></a>00261          <span class="keywordflow">if</span> ($duration != <span class="stringliteral">&#39;&#39;</span>) {
<a name="l00262"></a>00262             <span class="keywordflow">if</span> (!mysql_query(<span class="stringliteral">&quot;UPDATE opportunity SET duration=&#39;$duration&#39;</span>
<a name="l00263"></a>00263 <span class="stringliteral">      WHERE opportunityID=$opportunityID&quot;</span>))
<a name="l00264"></a>00264                die(<span class="stringliteral">&quot;Could not update duration with ID = $opportunityID&quot;</span>);
<a name="l00265"></a>00265          }<span class="keywordflow">if</span> ($rb != <span class="stringliteral">&#39;&#39;</span>) {
<a name="l00266"></a>00266             <span class="keywordflow">if</span> (!mysql_query(<span class="stringliteral">&quot;UPDATE opportunity SET responsibilities=&#39;$rb&#39;</span>
<a name="l00267"></a>00267 <span class="stringliteral">      WHERE opportunityID=$opportunityID&quot;</span>))
<a name="l00268"></a>00268                die(<span class="stringliteral">&quot;Could not update responsibilitys with ID =</span>
<a name="l00269"></a>00269 <span class="stringliteral">                        $opportunityID&quot;</span>);
<a name="l00270"></a>00270          }
<a name="l00271"></a>00271          <span class="keywordflow">if</span> ($qualif != <span class="stringliteral">&#39;&#39;</span>) {
<a name="l00272"></a>00272             <span class="keywordflow">if</span> (!mysql_query(<span class="stringliteral">&quot;UPDATE opportunity SET qualifications=&#39;$qualif&#39;</span>
<a name="l00273"></a>00273 <span class="stringliteral">      WHERE opportunityID=$opportunityID&quot;</span>))
<a name="l00274"></a>00274                die(<span class="stringliteral">&quot;Could not update qualifications with ID =</span>
<a name="l00275"></a>00275 <span class="stringliteral">                        $opportunityID&quot;</span>);
<a name="l00276"></a>00276          }
<a name="l00277"></a>00277          <span class="keywordflow">if</span> ($instruct != <span class="stringliteral">&#39;&#39;</span>) {
<a name="l00278"></a>00278             <span class="keywordflow">if</span> (!mysql_query(<span class="stringliteral">&quot;UPDATE opportunity SET instructions=&#39;$instruct&#39;</span>
<a name="l00279"></a>00279 <span class="stringliteral">      WHERE opportunityID=$opportunityID&quot;</span>))
<a name="l00280"></a>00280                die(<span class="stringliteral">&quot;Could not update instructions with ID =</span>
<a name="l00281"></a>00281 <span class="stringliteral">                        $opportunityID&quot;</span>);
<a name="l00282"></a>00282          }
<a name="l00283"></a>00283          <span class="keywordflow">if</span> ($comments != <span class="stringliteral">&#39;&#39;</span>) {
<a name="l00284"></a>00284             <span class="keywordflow">if</span> (!mysql_query(<span class="stringliteral">&quot;UPDATE opportunity SET comments=&#39;$comments&#39;</span>
<a name="l00285"></a>00285 <span class="stringliteral">      WHERE opportunityID=$opportunityID&quot;</span>))
<a name="l00286"></a>00286                die(<span class="stringliteral">&quot;Could not update comments with ID = $opportunityID&quot;</span>);
<a name="l00287"></a>00287          }
<a name="l00288"></a>00288          <span class="keywordflow">if</span> ($categories != <span class="stringliteral">&#39;&#39;</span>) {
<a name="l00289"></a>00289             <span class="keywordflow">if</span> (!mysql_query(<span class="stringliteral">&quot;UPDATE opportunity SET categories=&#39;$categories&#39;</span>
<a name="l00290"></a>00290 <span class="stringliteral">      WHERE opportunityID=$opportunityID&quot;</span>))
<a name="l00291"></a>00291                die(<span class="stringliteral">&quot;Could not update categories with ID = $opportunityID&quot;</span>);
<a name="l00292"></a>00292          }
<a name="l00293"></a>00293          <span class="keywordflow">if</span> ($pending != <span class="stringliteral">&#39;&#39;</span>) {
<a name="l00294"></a>00294             <span class="keywordflow">if</span> (!mysql_query(<span class="stringliteral">&quot;UPDATE opportunity SET pending=&#39;$pending&#39;</span>
<a name="l00295"></a>00295 <span class="stringliteral">      WHERE opportunityID=$opportunityID&quot;</span>))
<a name="l00296"></a>00296                die(<span class="stringliteral">&quot;Could not update pending with ID = $opportunityID&quot;</span>);
<a name="l00297"></a>00297          }
<a name="l00298"></a>00298          <span class="keywordflow">if</span> ($dateadded != <span class="stringliteral">&#39;&#39;</span>) {
<a name="l00299"></a>00299             <span class="keywordflow">if</span> (!mysql_query(<span class="stringliteral">&quot;UPDATE opportunity SET dateAdded=&#39;$dateadded&#39;</span>
<a name="l00300"></a>00300 <span class="stringliteral">      WHERE opportunityID=$opportunityID&quot;</span>))
<a name="l00301"></a>00301                die(<span class="stringliteral">&quot;Could not update dateAdded with ID = $opportunityID&quot;</span>);
<a name="l00302"></a>00302          }
<a name="l00303"></a>00303          mysql_close();
<a name="l00304"></a>00304          <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00305"></a>00305       }
<a name="l00306"></a>00306    }
<a name="l00307"></a>00307 
<a name="l00313"></a><a class="code" href="classdb_opportunity.html#aa6138359dee47e4b310d74fc17dc3ef0">00313</a>    <span class="keyword">static</span> <span class="keyword">function</span> <a class="code" href="classdb_opportunity.html#aa6138359dee47e4b310d74fc17dc3ef0">addOpportunity</a>($o, &amp;$id = null) {
<a name="l00314"></a>00314 
<a name="l00315"></a>00315       <span class="keywordflow">if</span> (!$o instanceof <a class="code" href="class_opportunity.html">Opportunity</a>) {
<a name="l00316"></a>00316          echo (<span class="stringliteral">&quot;Invalid arguement insertInto ( ) function&lt;br /&gt;&quot;</span>);
<a name="l00317"></a>00317          <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00318"></a>00318       }
<a name="l00319"></a>00319       <span class="comment">//Compose the INSERT INTO query string. Primary key values is missing.</span>
<a name="l00320"></a>00320       <span class="comment">//Database server automatically generates a unique ID for the primary</span>
<a name="l00321"></a>00321       <span class="comment">//key.</span>
<a name="l00322"></a>00322       <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> = sprintf(<span class="stringliteral">&quot;INSERT INTO opportunity VALUES(null, %d, %d, &#39;%s&#39;, </span>
<a name="l00323"></a>00323 <span class="stringliteral">            &#39;%s&#39;, &#39;%s&#39;, &#39;%s&#39;, &#39;%s&#39;, &#39;%s&#39;, &#39;%s&#39;, &#39;%s&#39;, &#39;%s&#39;, &#39;%s&#39;, %d, null)&quot;</span>, $o-&gt;getOrganizationID(), $o-&gt;getContactID(), $o-&gt;getTitle(), $o-&gt;getNumPositionsAvailable(), $o-&gt;getSemester(), $o-&gt;getPayRate(), $o-&gt;getDuration(), $o-&gt;getResponsibilities(), $o-&gt;getQualifications(), $o-&gt;getInstructions(), $o-&gt;getComments(), $o-&gt;getCategories(), $o-&gt;getPending()
<a name="l00324"></a>00324       );
<a name="l00325"></a>00325       <a class="code" href="db-control_2inc_2functions_8php.html#aca07cf60afd49a5a5b583459f5423045">connectToDatabase</a>();
<a name="l00326"></a>00326       <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> = mysql_query(<a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a>);
<a name="l00327"></a>00327       $id = mysql_insert_id();
<a name="l00328"></a>00328       echo mysql_error();
<a name="l00329"></a>00329       mysql_close();
<a name="l00330"></a>00330       <span class="keywordflow">if</span> (<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> == <span class="keyword">false</span>) {
<a name="l00331"></a>00331          <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00332"></a>00332       }
<a name="l00333"></a>00333 
<a name="l00334"></a>00334       <span class="comment">//Query was successful.</span>
<a name="l00335"></a>00335       printf(<span class="stringliteral">&quot;Opportunity added has id %d\n&lt;br /&gt;&quot;</span>, mysql_insert_id());
<a name="l00336"></a>00336       <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00337"></a>00337    }
<a name="l00338"></a>00338 
<a name="l00344"></a><a class="code" href="classdb_opportunity.html#a316a7f5c376a30ed3f4b5120470e434b">00344</a>    <span class="keyword">function</span> <a class="code" href="classdb_opportunity.html#a316a7f5c376a30ed3f4b5120470e434b">checkID</a>($o) {
<a name="l00345"></a>00345       <span class="keywordflow">if</span> (!($o instanceof <a class="code" href="class_opportunity.html">Opportunity</a>)) {
<a name="l00346"></a>00346          <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00347"></a>00347       }
<a name="l00348"></a>00348       $opportunityID = $o-&gt;checkOpportunity();
<a name="l00349"></a>00349       <a class="code" href="db-control_2inc_2functions_8php.html#aca07cf60afd49a5a5b583459f5423045">connectToDatabase</a>();
<a name="l00350"></a>00350       <span class="keywordflow">if</span> (mysql_num_rows(mysql_query(<span class="stringliteral">&quot;SELECT * FROM opportunity WHERE</span>
<a name="l00351"></a>00351 <span class="stringliteral">      opportunityID=$opportunityID&quot;</span>)) == 0) {
<a name="l00352"></a>00352          echo mysql_error();
<a name="l00353"></a>00353          mysql_close();
<a name="l00354"></a>00354          <span class="comment">//nothing exists mysql_num_rows</span>
<a name="l00355"></a>00355          <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00356"></a>00356       } <span class="keywordflow">else</span> {
<a name="l00357"></a>00357          <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00358"></a>00358       }
<a name="l00359"></a>00359    }
<a name="l00360"></a>00360 
<a name="l00367"></a><a class="code" href="classdb_opportunity.html#a64d00cefa3073adbd4728a60ce74482d">00367</a>    <span class="keyword">function</span> <a class="code" href="classdb_opportunity.html#a64d00cefa3073adbd4728a60ce74482d">getOpportunity</a>($opportunityID) {
<a name="l00368"></a>00368       $o = <span class="keyword">new</span> <a class="code" href="class_opportunity.html">Opportunity</a>();
<a name="l00369"></a>00369       <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> = mysql_query(<span class="stringliteral">&quot;SELECT * FROM opportunity WHERE opportunityID=</span>
<a name="l00370"></a>00370 <span class="stringliteral">      $opportunityID&quot;</span>);
<a name="l00371"></a>00371       <span class="keywordflow">if</span> (!<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>) {
<a name="l00372"></a>00372          <span class="keywordflow">return</span> <span class="keyword">false</span>; <span class="comment">//id does not exist</span>
<a name="l00373"></a>00373       } <span class="keywordflow">else</span> {
<a name="l00374"></a>00374          $row = mysql_fetch_assoc(<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>);
<a name="l00375"></a>00375          $o-&gt;setOpportunityID($opportunityID);
<a name="l00376"></a>00376          $o-&gt;setOrganizationID($row[<span class="stringliteral">&#39;organizationID&#39;</span>]);
<a name="l00377"></a>00377          $o-&gt;setContactID($row[<span class="stringliteral">&#39;contactID&#39;</span>]);
<a name="l00378"></a>00378          $o-&gt;setTitle($row[<span class="stringliteral">&#39;title&#39;</span>]);
<a name="l00379"></a>00379          $o-&gt;setNumPositionsAvailable($row[<span class="stringliteral">&#39;numPositionsAvailable&#39;</span>]);
<a name="l00380"></a>00380          $o-&gt;setSemester($row[<span class="stringliteral">&#39;semester&#39;</span>]);
<a name="l00381"></a>00381          $o-&gt;setPayrate($row[<span class="stringliteral">&#39;payRate&#39;</span>]);
<a name="l00382"></a>00382          $o-&gt;setDuration($row[<span class="stringliteral">&#39;duration&#39;</span>]);
<a name="l00383"></a>00383          $o-&gt;setResponsibilities($row[<span class="stringliteral">&#39;responsibilities&#39;</span>]);
<a name="l00384"></a>00384          $o-&gt;setQualifications($row[<span class="stringliteral">&#39;qualifications&#39;</span>]);
<a name="l00385"></a>00385          $o-&gt;setInstructions($row[<span class="stringliteral">&#39;instructions&#39;</span>]);
<a name="l00386"></a>00386          $o-&gt;setComments($row[<span class="stringliteral">&#39;comments&#39;</span>]);
<a name="l00387"></a>00387          $o-&gt;setCategories($row[<span class="stringliteral">&#39;categories&#39;</span>]);
<a name="l00388"></a>00388          $o-&gt;setPending($row[<span class="stringliteral">&#39;pending&#39;</span>]);
<a name="l00389"></a>00389          $o-&gt;setDateAdded($row[<span class="stringliteral">&#39;dateadded&#39;</span>]);
<a name="l00390"></a>00390          <span class="keywordflow">return</span> $o;
<a name="l00391"></a>00391       }
<a name="l00392"></a>00392    }
<a name="l00393"></a>00393 
<a name="l00394"></a><a class="code" href="classdb_opportunity.html#aec9b0fef665ef9dfab3b8c63b7339bcd">00394</a>    <span class="keyword">function</span> <a class="code" href="classdb_opportunity.html#aec9b0fef665ef9dfab3b8c63b7339bcd">getOpportunityID</a>($o) {
<a name="l00395"></a>00395       <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> = mysql_query(<span class="stringliteral">&quot;SELECT opportunityID FROM opportunity WHERE</span>
<a name="l00396"></a>00396 <span class="stringliteral">            opportunityID=&#39;$o&#39;&quot;</span>);
<a name="l00397"></a>00397       $row = mysql_fetch_row(<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>);
<a name="l00398"></a>00398       <span class="keywordflow">return</span> $row[<span class="charliteral">&#39;0&#39;</span>];
<a name="l00399"></a>00399    }
<a name="l00400"></a>00400 
<a name="l00401"></a><a class="code" href="classdb_opportunity.html#ae08ebacf19877370e18d4ddc9d70cf95">00401</a>    <span class="keyword">function</span> <a class="code" href="classdb_opportunity.html#ae08ebacf19877370e18d4ddc9d70cf95">getOrganizationID</a>($o) {
<a name="l00402"></a>00402       <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> = <span class="stringliteral">&quot;SELECT organizationID FROM opportunity</span>
<a name="l00403"></a>00403 <span class="stringliteral">        WHERE opportunityID=&#39;$o&#39;&quot;</span>;
<a name="l00404"></a>00404       <a class="code" href="db-control_2inc_2functions_8php.html#aca07cf60afd49a5a5b583459f5423045">connectToDatabase</a>();
<a name="l00405"></a>00405       <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> = mysql_query(<a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a>);
<a name="l00406"></a>00406       mysql_close();
<a name="l00407"></a>00407       <span class="keywordflow">if</span> (<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> == <span class="keyword">false</span>) {
<a name="l00408"></a>00408          echo mysql_error();
<a name="l00409"></a>00409          <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00410"></a>00410       }
<a name="l00411"></a>00411       <span class="comment">//Query was successful.</span>
<a name="l00412"></a>00412       <span class="keywordflow">return</span> <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>;
<a name="l00413"></a>00413    }
<a name="l00414"></a>00414 
<a name="l00415"></a><a class="code" href="classdb_opportunity.html#aa182109adc81740de9cf1895474c3d2c">00415</a>    <span class="keyword">function</span> <a class="code" href="classdb_opportunity.html#aa182109adc81740de9cf1895474c3d2c">getContactID</a>($o) {
<a name="l00416"></a>00416       <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> = <span class="stringliteral">&quot;SELECT contactID FROM opportunity</span>
<a name="l00417"></a>00417 <span class="stringliteral">        WHERE opportunityID=&#39;$o&#39;&quot;</span>;
<a name="l00418"></a>00418       <a class="code" href="db-control_2inc_2functions_8php.html#aca07cf60afd49a5a5b583459f5423045">connectToDatabase</a>();
<a name="l00419"></a>00419       <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> = mysql_query(<a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a>);
<a name="l00420"></a>00420       mysql_close();
<a name="l00421"></a>00421       <span class="keywordflow">if</span> (<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> == <span class="keyword">false</span>) {
<a name="l00422"></a>00422          echo mysql_error();
<a name="l00423"></a>00423          <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00424"></a>00424       }
<a name="l00425"></a>00425       <span class="comment">//Query was successful.</span>
<a name="l00426"></a>00426       <span class="keywordflow">return</span> <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>;
<a name="l00427"></a>00427    }
<a name="l00428"></a>00428 
<a name="l00429"></a><a class="code" href="classdb_opportunity.html#aa04834cf0a04caad6c1da743eedee5ba">00429</a>    <span class="keyword">function</span> <a class="code" href="classdb_opportunity.html#aa04834cf0a04caad6c1da743eedee5ba">getTitle</a>($o) {
<a name="l00430"></a>00430       <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> = <span class="stringliteral">&quot;SELECT title FROM opportunity</span>
<a name="l00431"></a>00431 <span class="stringliteral">        WHERE opportunityID=&#39;$o&#39;&quot;</span>;
<a name="l00432"></a>00432       <a class="code" href="db-control_2inc_2functions_8php.html#aca07cf60afd49a5a5b583459f5423045">connectToDatabase</a>();
<a name="l00433"></a>00433       <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> = mysql_query(<a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a>);
<a name="l00434"></a>00434       mysql_close();
<a name="l00435"></a>00435       <span class="keywordflow">if</span> (<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> == <span class="keyword">false</span>) {
<a name="l00436"></a>00436          echo mysql_error();
<a name="l00437"></a>00437          <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00438"></a>00438       }
<a name="l00439"></a>00439       <span class="comment">//Query was successful.</span>
<a name="l00440"></a>00440       <span class="keywordflow">return</span> <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>;
<a name="l00441"></a>00441    }
<a name="l00442"></a>00442 
<a name="l00443"></a><a class="code" href="classdb_opportunity.html#a3f5dacb26be08e1c71a99ddfcefb6355">00443</a>    <span class="keyword">function</span> <a class="code" href="classdb_opportunity.html#a3f5dacb26be08e1c71a99ddfcefb6355">getNumPositionsAvailable</a>($o) {
<a name="l00444"></a>00444       <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> = <span class="stringliteral">&quot;SELECT numPositionsAvailable FROM opportunity</span>
<a name="l00445"></a>00445 <span class="stringliteral">        WHERE opportunityID=&#39;$o&#39;&quot;</span>;
<a name="l00446"></a>00446       <a class="code" href="db-control_2inc_2functions_8php.html#aca07cf60afd49a5a5b583459f5423045">connectToDatabase</a>();
<a name="l00447"></a>00447       <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> = mysql_query(<a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a>);
<a name="l00448"></a>00448       mysql_close();
<a name="l00449"></a>00449       <span class="keywordflow">if</span> (<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> == <span class="keyword">false</span>) {
<a name="l00450"></a>00450          echo mysql_error();
<a name="l00451"></a>00451          <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00452"></a>00452       }
<a name="l00453"></a>00453       <span class="comment">//Query was successful.</span>
<a name="l00454"></a>00454       <span class="keywordflow">return</span> <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>;
<a name="l00455"></a>00455    }
<a name="l00456"></a>00456 
<a name="l00457"></a><a class="code" href="classdb_opportunity.html#ad4b8db2f34e538a27126e8a34db6dbdc">00457</a>    <span class="keyword">function</span> <a class="code" href="classdb_opportunity.html#ad4b8db2f34e538a27126e8a34db6dbdc">getSemester</a>($o) {
<a name="l00458"></a>00458       <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> = <span class="stringliteral">&quot;SELECT semester FROM opportunity</span>
<a name="l00459"></a>00459 <span class="stringliteral">        WHERE opportunityID=&#39;$o&#39;&quot;</span>;
<a name="l00460"></a>00460       <a class="code" href="db-control_2inc_2functions_8php.html#aca07cf60afd49a5a5b583459f5423045">connectToDatabase</a>();
<a name="l00461"></a>00461       <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> = mysql_query(<a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a>);
<a name="l00462"></a>00462       mysql_close();
<a name="l00463"></a>00463       <span class="keywordflow">if</span> (<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> == <span class="keyword">false</span>) {
<a name="l00464"></a>00464          echo mysql_error();
<a name="l00465"></a>00465          <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00466"></a>00466       }
<a name="l00467"></a>00467       <span class="comment">//Query was successful.</span>
<a name="l00468"></a>00468       <span class="keywordflow">return</span> <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>;
<a name="l00469"></a>00469    }
<a name="l00470"></a>00470 
<a name="l00471"></a><a class="code" href="classdb_opportunity.html#aba3eefe6517df04c9ad1fc9473954a1b">00471</a>    <span class="keyword">function</span> <a class="code" href="classdb_opportunity.html#aba3eefe6517df04c9ad1fc9473954a1b">getPayRate</a>($o) {
<a name="l00472"></a>00472       <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> = <span class="stringliteral">&quot;SELECT payRate FROM opportunity</span>
<a name="l00473"></a>00473 <span class="stringliteral">        WHERE opportunityID=&#39;$o&#39;&quot;</span>;
<a name="l00474"></a>00474       <a class="code" href="db-control_2inc_2functions_8php.html#aca07cf60afd49a5a5b583459f5423045">connectToDatabase</a>();
<a name="l00475"></a>00475       <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> = mysql_query(<a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a>);
<a name="l00476"></a>00476       mysql_close();
<a name="l00477"></a>00477       <span class="keywordflow">if</span> (<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> == <span class="keyword">false</span>) {
<a name="l00478"></a>00478          echo mysql_error();
<a name="l00479"></a>00479          <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00480"></a>00480       }
<a name="l00481"></a>00481       <span class="comment">//Query was successful.</span>
<a name="l00482"></a>00482       <span class="keywordflow">return</span> <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>;
<a name="l00483"></a>00483    }
<a name="l00484"></a>00484 
<a name="l00485"></a><a class="code" href="classdb_opportunity.html#a77900199aeddab8a2ac6101ceb9c2783">00485</a>    <span class="keyword">function</span> <a class="code" href="classdb_opportunity.html#a77900199aeddab8a2ac6101ceb9c2783">getDuration</a>($o) {
<a name="l00486"></a>00486       <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> = <span class="stringliteral">&quot;SELECT duration FROM opportunity</span>
<a name="l00487"></a>00487 <span class="stringliteral">        WHERE opportunityID=&#39;$o&#39;&quot;</span>;
<a name="l00488"></a>00488       <a class="code" href="db-control_2inc_2functions_8php.html#aca07cf60afd49a5a5b583459f5423045">connectToDatabase</a>();
<a name="l00489"></a>00489       <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> = mysql_query(<a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a>);
<a name="l00490"></a>00490       mysql_close();
<a name="l00491"></a>00491       <span class="keywordflow">if</span> (<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> == <span class="keyword">false</span>) {
<a name="l00492"></a>00492          echo mysql_error();
<a name="l00493"></a>00493          <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00494"></a>00494       }
<a name="l00495"></a>00495       <span class="comment">//Query was successful.</span>
<a name="l00496"></a>00496       <span class="keywordflow">return</span> <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>;
<a name="l00497"></a>00497    }
<a name="l00498"></a>00498 
<a name="l00499"></a><a class="code" href="classdb_opportunity.html#a5cb1cf39e5d1604b25873659a4d5ce71">00499</a>    <span class="keyword">function</span> <a class="code" href="classdb_opportunity.html#a5cb1cf39e5d1604b25873659a4d5ce71">getResponsibilities</a>($o) {
<a name="l00500"></a>00500       <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> = <span class="stringliteral">&quot;SELECT responsibilities FROM opportunity</span>
<a name="l00501"></a>00501 <span class="stringliteral">        WHERE opportunityID=&#39;$o&#39;&quot;</span>;
<a name="l00502"></a>00502       <a class="code" href="db-control_2inc_2functions_8php.html#aca07cf60afd49a5a5b583459f5423045">connectToDatabase</a>();
<a name="l00503"></a>00503       <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> = mysql_query(<a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a>);
<a name="l00504"></a>00504       mysql_close();
<a name="l00505"></a>00505       <span class="keywordflow">if</span> (<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> == <span class="keyword">false</span>) {
<a name="l00506"></a>00506          echo mysql_error();
<a name="l00507"></a>00507          <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00508"></a>00508       }
<a name="l00509"></a>00509       <span class="comment">//Query was successful.</span>
<a name="l00510"></a>00510       <span class="keywordflow">return</span> <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>;
<a name="l00511"></a>00511    }
<a name="l00512"></a>00512 
<a name="l00513"></a><a class="code" href="classdb_opportunity.html#a32d19577d92e17b4ab00cafae0c4c69a">00513</a>    <span class="keyword">function</span> <a class="code" href="classdb_opportunity.html#a32d19577d92e17b4ab00cafae0c4c69a">getQualifications</a>($o) {
<a name="l00514"></a>00514       <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> = <span class="stringliteral">&quot;SELECT qualifications FROM opportunity</span>
<a name="l00515"></a>00515 <span class="stringliteral">        WHERE opportunityID=&#39;$o&#39;&quot;</span>;
<a name="l00516"></a>00516       <a class="code" href="db-control_2inc_2functions_8php.html#aca07cf60afd49a5a5b583459f5423045">connectToDatabase</a>();
<a name="l00517"></a>00517       <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> = mysql_query(<a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a>);
<a name="l00518"></a>00518       mysql_close();
<a name="l00519"></a>00519       <span class="keywordflow">if</span> (<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> == <span class="keyword">false</span>) {
<a name="l00520"></a>00520          echo mysql_error();
<a name="l00521"></a>00521          <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00522"></a>00522       }
<a name="l00523"></a>00523       <span class="comment">//Query was successful.</span>
<a name="l00524"></a>00524       <span class="keywordflow">return</span> <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>;
<a name="l00525"></a>00525    }
<a name="l00526"></a>00526 
<a name="l00527"></a><a class="code" href="classdb_opportunity.html#a3735fc4415291382e7e16a01db4dc42b">00527</a>    <span class="keyword">function</span> <a class="code" href="classdb_opportunity.html#a3735fc4415291382e7e16a01db4dc42b">getInstructions</a>($o) {
<a name="l00528"></a>00528       <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> = <span class="stringliteral">&quot;SELECT instructions FROM opportunity</span>
<a name="l00529"></a>00529 <span class="stringliteral">        WHERE opportunityID=&#39;$o&#39;&quot;</span>;
<a name="l00530"></a>00530       <a class="code" href="db-control_2inc_2functions_8php.html#aca07cf60afd49a5a5b583459f5423045">connectToDatabase</a>();
<a name="l00531"></a>00531       <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> = mysql_query(<a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a>);
<a name="l00532"></a>00532       mysql_close();
<a name="l00533"></a>00533       <span class="keywordflow">if</span> (<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> == <span class="keyword">false</span>) {
<a name="l00534"></a>00534          echo mysql_error();
<a name="l00535"></a>00535          <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00536"></a>00536       }
<a name="l00537"></a>00537       <span class="comment">//Query was successful.</span>
<a name="l00538"></a>00538       <span class="keywordflow">return</span> <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>;
<a name="l00539"></a>00539    }
<a name="l00540"></a>00540 
<a name="l00541"></a><a class="code" href="classdb_opportunity.html#aa5dd7589303c722b539ed99baf47bf56">00541</a>    <span class="keyword">function</span> <a class="code" href="classdb_opportunity.html#aa5dd7589303c722b539ed99baf47bf56">getComments</a>($o) {
<a name="l00542"></a>00542       <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> = <span class="stringliteral">&quot;SELECT comments FROM opportunity</span>
<a name="l00543"></a>00543 <span class="stringliteral">        WHERE opportunityID=&#39;$o&#39;&quot;</span>;
<a name="l00544"></a>00544       <a class="code" href="db-control_2inc_2functions_8php.html#aca07cf60afd49a5a5b583459f5423045">connectToDatabase</a>();
<a name="l00545"></a>00545       <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> = mysql_query(<a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a>);
<a name="l00546"></a>00546       mysql_close();
<a name="l00547"></a>00547       <span class="keywordflow">if</span> (<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> == <span class="keyword">false</span>) {
<a name="l00548"></a>00548          echo mysql_error();
<a name="l00549"></a>00549          <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00550"></a>00550       }
<a name="l00551"></a>00551       <span class="comment">//Query was successful.</span>
<a name="l00552"></a>00552       <span class="keywordflow">return</span> <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>;
<a name="l00553"></a>00553    }
<a name="l00554"></a>00554 
<a name="l00555"></a><a class="code" href="classdb_opportunity.html#a489d394095690d4789dc213e2e8f6a64">00555</a>    <span class="keyword">function</span> <a class="code" href="classdb_opportunity.html#a489d394095690d4789dc213e2e8f6a64">getCategories</a>($o) {
<a name="l00556"></a>00556       <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> = <span class="stringliteral">&quot;SELECT categories FROM opportunity</span>
<a name="l00557"></a>00557 <span class="stringliteral">        WHERE opportunityID=&#39;$o&#39;&quot;</span>;
<a name="l00558"></a>00558       <a class="code" href="db-control_2inc_2functions_8php.html#aca07cf60afd49a5a5b583459f5423045">connectToDatabase</a>();
<a name="l00559"></a>00559       <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> = mysql_query(<a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a>);
<a name="l00560"></a>00560       mysql_close();
<a name="l00561"></a>00561       <span class="keywordflow">if</span> (<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> == <span class="keyword">false</span>) {
<a name="l00562"></a>00562          echo mysql_error();
<a name="l00563"></a>00563          <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00564"></a>00564       }
<a name="l00565"></a>00565       <span class="comment">//Query was successful.</span>
<a name="l00566"></a>00566       <span class="keywordflow">return</span> <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>;
<a name="l00567"></a>00567    }
<a name="l00568"></a>00568 
<a name="l00569"></a><a class="code" href="classdb_opportunity.html#a8537d4bd19824f35db9bfdd246924129">00569</a>    <span class="keyword">function</span> <a class="code" href="classdb_opportunity.html#a8537d4bd19824f35db9bfdd246924129">getPending</a>($o) {
<a name="l00570"></a>00570       <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> = <span class="stringliteral">&quot;SELECT pending FROM opportunity</span>
<a name="l00571"></a>00571 <span class="stringliteral">        WHERE opportunityID=&#39;$o&#39;&quot;</span>;
<a name="l00572"></a>00572       <a class="code" href="db-control_2inc_2functions_8php.html#aca07cf60afd49a5a5b583459f5423045">connectToDatabase</a>();
<a name="l00573"></a>00573       <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> = mysql_query(<a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a>);
<a name="l00574"></a>00574       mysql_close();
<a name="l00575"></a>00575       <span class="keywordflow">if</span> (<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> == <span class="keyword">false</span>) {
<a name="l00576"></a>00576          echo mysql_error();
<a name="l00577"></a>00577          <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00578"></a>00578       }
<a name="l00579"></a>00579       <span class="comment">//Query was successful.</span>
<a name="l00580"></a>00580       <span class="keywordflow">return</span> <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>;
<a name="l00581"></a>00581    }
<a name="l00582"></a>00582 
<a name="l00583"></a><a class="code" href="classdb_opportunity.html#a033c71889aee7ed584f3ecada01764bc">00583</a>    <span class="keyword">function</span> <a class="code" href="classdb_opportunity.html#a033c71889aee7ed584f3ecada01764bc">getDateAdded</a>($o) {
<a name="l00584"></a>00584       <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> = <span class="stringliteral">&quot;SELECT dateAdded FROM opportunity</span>
<a name="l00585"></a>00585 <span class="stringliteral">        WHERE opportunityID=&#39;$o&#39;&quot;</span>;
<a name="l00586"></a>00586       <a class="code" href="db-control_2inc_2functions_8php.html#aca07cf60afd49a5a5b583459f5423045">connectToDatabase</a>();
<a name="l00587"></a>00587       <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> = mysql_query(<a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a>);
<a name="l00588"></a>00588       mysql_close();
<a name="l00589"></a>00589       <span class="keywordflow">if</span> (<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> == <span class="keyword">false</span>) {
<a name="l00590"></a>00590          echo mysql_error();
<a name="l00591"></a>00591          <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00592"></a>00592       }
<a name="l00593"></a>00593       <span class="comment">//Query was successful.</span>
<a name="l00594"></a>00594       <span class="keywordflow">return</span> <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>;
<a name="l00595"></a>00595    }
<a name="l00596"></a>00596 
<a name="l00597"></a><a class="code" href="classdb_opportunity.html#a2dfd5427fef776258f77a33a83c72411">00597</a>    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">function</span> <a class="code" href="classdb_opportunity.html#a2dfd5427fef776258f77a33a83c72411">getAllByID</a>($id, &amp;$output = null) {
<a name="l00598"></a>00598       <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> = sprintf(<span class="stringliteral">&quot;SELECT organizationID, contactID, title,</span>
<a name="l00599"></a>00599 <span class="stringliteral">            numPositionsAvailable,semester, payRate, duration, responsibilities,</span>
<a name="l00600"></a>00600 <span class="stringliteral">            qualifications, instructions, comments, categories, dateAdded FROM</span>
<a name="l00601"></a>00601 <span class="stringliteral">            opportunity WHERE opportunityID=%d&quot;</span>, $id);
<a name="l00602"></a>00602       <span class="comment">//printf(&quot;-&gt;Query: %s&lt;br /&gt;&quot;, $query);</span>
<a name="l00603"></a>00603       <a class="code" href="db-control_2inc_2functions_8php.html#aca07cf60afd49a5a5b583459f5423045">connectToDatabase</a>();
<a name="l00604"></a>00604       <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> = mysql_query(<a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a>);
<a name="l00605"></a>00605       mysql_close();
<a name="l00606"></a>00606 
<a name="l00607"></a>00607       <span class="keywordflow">if</span> (<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> == <span class="keyword">false</span>) {
<a name="l00608"></a>00608          $output = sprintf(<span class="stringliteral">&quot;%s&quot;</span>, mysql_error());
<a name="l00609"></a>00609          <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00610"></a>00610       }
<a name="l00611"></a>00611       <span class="comment">//process result and print out warning or attribute values</span>
<a name="l00612"></a>00612       <span class="keywordflow">return</span> dbOpportunity::checkForOneInstance(<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>, $id, $output);
<a name="l00613"></a>00613    }
<a name="l00614"></a>00614 
<a name="l00615"></a>00615    <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">function</span> checkForOneInstance(<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>, $id, &amp;$output) {
<a name="l00616"></a>00616       <span class="comment">//Local variables are initialized.</span>
<a name="l00617"></a>00617       $errorStatus = <span class="keyword">false</span>;
<a name="l00618"></a>00618 
<a name="l00619"></a>00619       $howMany = mysql_num_rows(<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>);
<a name="l00620"></a>00620       <span class="comment">//printf(&quot;-&gt;Found %d instance(s) for organizationID=%d.&lt;br /&gt;&quot;, $howMany, $id);</span>
<a name="l00621"></a>00621       <span class="keywordflow">switch</span> ($howMany) {
<a name="l00622"></a>00622          <span class="keywordflow">case</span> 0:
<a name="l00623"></a>00623             $output = sprintf(<span class="stringliteral">&quot;No Opportunity instance with ID=%d was found.&quot;</span>, $id);
<a name="l00624"></a>00624             $errorStatus = <span class="keyword">true</span>;
<a name="l00625"></a>00625             <span class="keywordflow">break</span>;
<a name="l00626"></a>00626          <span class="keywordflow">case</span> 1:
<a name="l00627"></a>00627             <span class="comment">//mysql_fetch() DOES NOT return primary key values</span>
<a name="l00628"></a>00628             $output = mysql_fetch_assoc(<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>);
<a name="l00629"></a>00629             $errorStatus = <span class="keyword">false</span>;
<a name="l00630"></a>00630             <span class="keywordflow">break</span>;
<a name="l00631"></a>00631          <span class="keywordflow">default</span>:
<a name="l00632"></a>00632             $output = sprintf(<span class="stringliteral">&quot;There are multiple Opportunities instances with</span>
<a name="l00633"></a>00633 <span class="stringliteral">                                  ID=%d.&quot;</span>, $id);
<a name="l00634"></a>00634             $errorStatus = <span class="keyword">true</span>;
<a name="l00635"></a>00635             <span class="keywordflow">break</span>;
<a name="l00636"></a>00636       }
<a name="l00637"></a>00637       <span class="keywordflow">return</span> $errorStatus;
<a name="l00638"></a>00638    }
<a name="l00639"></a>00639 
<a name="l00640"></a>00640 }
<a name="l00641"></a>00641 
<a name="l00642"></a>00642 ?&gt;
</pre></div></div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Tue Nov 29 2011 18:18:54 for i2c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
